/*
 * Copyright:  2018 smarabbit studio.
 *
 *  Licensed under the Confluent Community License; you may not use this file
 *  except in compliance with the License.  You may obtain a copy of the License at
 *
 *  http://www.confluent.io/confluent-community-license
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 *  WARRANTIES OF ANY KIND, either express or implied.  See the License for the
 *  specific language governing permissions and limitations under the License.
 *
 *  @作   者： 黄开晖 (117227773@qq.com)
 *  @日   期: 2019年12月2日
 */
package com.massyframework.beanskin.util.sorting.graph;

/**
 * {@link Edge},边
 * @author huangkh
 *
 */
public class Edge {
    private Object info; 
    private int weight;  
    private EdgeType type; 
    
    /**
     * 创建新实例
     * @param weight {@link int},权重
     */
    public Edge(int weight) {
        this.info = null;
        this.weight = weight;
        this.type = EdgeType.UNKNOWN;
    }
    
    /**
     * 创建新实例
     * @param weight {@link int},权重
     * @param info {@link Object},边包含的信息
     */
    public Edge(int weight,Object info) {
        this.info = info;
        this.weight = weight;
        this.type = EdgeType.UNKNOWN;
    }
    
    /**
     * 边的信息
     * @return {@link Object},可能为null.
     */
    public Object getInfo() {
        return info;
    }
    
    /**
     * 设置边的信息
     * @param info {@link Object}
     */
    public void setInfo(Object info) {
        this.info = info;
    }
    
    /**
     * 权重
     * @return {@link int}
     */
    public int getWeight() {
        return weight;
    }
    
    /**
     * 设置边的权重
     * @param weight {@link int}
     */
    public void setWeight(int weight) {
        this.weight = weight;
    }
    
    /**
     * 边的类型
     * @return {@link EdgeType}
     */
    public EdgeType getType() {
        return type;
    }
    
    /**
     * 设置边的类型
     * @param type {@link EdgeType}
     */
    public void setType(EdgeType type) {
        this.type = type;
    }
}
